Methods for computing ignition angles in which knock signals indicating knocking combustion are taken into account are known. Typically, the ignition angle is immediately retarded when knocking combustion occurs. If knock then stops for a certain time, the ignition angle is gradually advanced again.